package cn.xscrum.vtsp.service.impl;

import java.util.List;
import cn.xscrum.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.xscrum.vtsp.mapper.VtspAppraiseMapper;
import cn.xscrum.vtsp.domain.VtspAppraise;
import cn.xscrum.vtsp.service.IVtspAppraiseService;
import cn.xscrum.common.core.text.Convert;

/**
 * 志愿者评价信息Service业务层处理
 *
 * @author xscrum
 * @date 2021-10-01
 */
@Service
public class VtspAppraiseServiceImpl implements IVtspAppraiseService
{
    @Autowired
    private VtspAppraiseMapper vtspAppraiseMapper;

    /**
	 * 查询志愿者评价信息
     *
     * @param appraiseId 志愿者评价信息ID
     * @return 志愿者评价信息
     */
    @Override
    public VtspAppraise selectVtspAppraiseById(Long appraiseId)
    {
        return vtspAppraiseMapper.selectVtspAppraiseById(appraiseId);
    }

    @Override
    public VtspAppraise queryVtspAppraiseById(Long enrollId)
    {
        return vtspAppraiseMapper.queryVtspAppraiseById(enrollId);
    }
    @Override
    public List<VtspAppraise> selectVtspAppraiseScore(Long volunteerId) {
        return vtspAppraiseMapper.selectVtspAppraiseScore(volunteerId);
    }
    public VtspAppraise selectVtspAppraiseById2(Long enrollId)
    {
        return vtspAppraiseMapper.selectVtspAppraiseById(enrollId);
    }

    /**
	 * 查询志愿者评价信息列表
     *
     * @param vtspAppraise 志愿者评价信息
     * @return 志愿者评价信息
     */
    @Override
    public List<VtspAppraise> selectVtspAppraiseList(VtspAppraise vtspAppraise)
    {
        return vtspAppraiseMapper.selectVtspAppraiseList(vtspAppraise);
    }
    @Override
    public List<VtspAppraise> list(VtspAppraise vtspAppraise)
    {
        return vtspAppraiseMapper.list(vtspAppraise);
    }

    /**
	 * 新增志愿者评价信息
     *
     * @param vtspAppraise 志愿者评价信息
     * @return 结果
     */
    @Override
    public int insertVtspAppraise(VtspAppraise vtspAppraise)
    {
        vtspAppraise.setCreateTime(DateUtils.getNowDate());
        return vtspAppraiseMapper.insertVtspAppraise(vtspAppraise);
    }

    /**
	 * 修改志愿者评价信息
     *
     * @param vtspAppraise 志愿者评价信息
     * @return 结果
     */
    @Override
    public int updateVtspAppraise(VtspAppraise vtspAppraise)
    {
        vtspAppraise.setUpdateTime(DateUtils.getNowDate());
        return vtspAppraiseMapper.updateVtspAppraise(vtspAppraise);
    }

    /**
	 * 删除志愿者评价信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteVtspAppraiseByIds(String ids)
    {
        return vtspAppraiseMapper.deleteVtspAppraiseByIds(Convert.toStrArray(ids));
    }

    /**
	 * 删除志愿者评价信息信息
     *
     * @param appraiseId 志愿者评价信息ID
     * @return 结果
     */
    @Override
    public int deleteVtspAppraiseById(Long appraiseId)
    {
        return vtspAppraiseMapper.deleteVtspAppraiseById(appraiseId);
    }
}
